package com.Main.faislamovers;

import java.io.IOException;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.MarshalBase64;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;
import android.R.string;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

public class FromTo extends Activity {

	SharedPreferences prefs;
	String val, val2;
	String NAMESPACE = "http://tempuri.org/";
	String METHODNAME = "Reservation";
	String url = "http://10.0.2.2:53512/Service1.asmx";
	String SopaAction = "http://tempuri.org/Reservation";
	TextView txt_numb_seats;

	ArrayList<Integer> seats;
	String[] registeredSeats;
	List<String> reg_seats;
	string numb_of_seat = null;
	int seat_numb = 0;
	ImageButton btn_seat_1, btn_seat_2, btn_seat_3, btn_seat_4, btn_seat_5,
			btn_seat_6, btn_seat_7, btn_seat_8, btn_seat_9, btn_seat_10;
	ImageButton btn_seat_11, btn_seat_12, btn_seat_13, btn_seat_14,
			btn_seat_15, btn_seat_16, btn_seat_17, btn_seat_18, btn_seat_19,
			btn_seat_20;
	ImageButton btn_seat_21, btn_seat_22, btn_seat_23, btn_seat_24,
			btn_seat_25, btn_seat_26, btn_seat_27, btn_seat_28, btn_seat_29,
			btn_seat_30;
	ImageButton btn_seat_31, btn_seat_32, btn_seat_33, btn_seat_34,
			btn_seat_35, btn_seat_36, btn_seat_37, btn_seat_38, btn_seat_39,
			btn_seat_40;
	ImageButton btn_seat_41, btn_seat_42, btn_seat_43, btn_seat_44,
			btn_seat_45, btn_seat_46, btn_seat_47, btn_seat_48, btn_seat_49,
			btn_seat_50;
	int id_user,travle_id;
	Button btn_proceed;
	boolean isChecked[];

	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		// requestWindowFeature(Window.FEATURE_NO_TITLE);
		// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
		// WindowManager.LayoutParams.FLAG_FULLSCREEN);

		setContentView(R.layout.fromto);
		seats = new ArrayList<Integer>();
		isChecked = new boolean[48];

		txt_numb_seats = (TextView) findViewById(R.id.txt_numb_seats);
		prefs = getSharedPreferences(AppConstants.PREFERENCES_NAME, 0);
		
		registeredSeats = getIntent().getStringArrayExtra(AppConstants.SEATS_LIST);
		reg_seats = Arrays.asList(registeredSeats);
		btn_seat_1 = (ImageButton) findViewById(R.id.image_btn_1);
		if(reg_seats.contains("1"))
		{
			btn_seat_1.setEnabled(false);
			btn_seat_1.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_2 = (ImageButton) findViewById(R.id.image_btn_2);
		if(reg_seats.contains("2"))
		{
			btn_seat_2.setEnabled(false);
			btn_seat_2.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_3 = (ImageButton) findViewById(R.id.image_btn_3);
		if(reg_seats.contains("3"))
		{
			btn_seat_3.setEnabled(false);
			btn_seat_3.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_4 = (ImageButton) findViewById(R.id.image_btn_4);
		if(reg_seats.contains("4"))
		{
			btn_seat_4.setEnabled(false);
			btn_seat_4.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_5 = (ImageButton) findViewById(R.id.image_btn_5);
		if(reg_seats.contains("5"))
		{
			btn_seat_5.setEnabled(false);
			btn_seat_5.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_6 = (ImageButton) findViewById(R.id.image_btn_6);
		if(reg_seats.contains("6"))
		{
			btn_seat_6.setEnabled(false);
			btn_seat_6.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_7 = (ImageButton) findViewById(R.id.image_btn_7);
		if(reg_seats.contains("7"))
		{
			btn_seat_7.setEnabled(false);
			btn_seat_7.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_8 = (ImageButton) findViewById(R.id.image_btn_8);
		if(reg_seats.contains("8"))
		{
			btn_seat_8.setEnabled(false);
			btn_seat_8.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_9 = (ImageButton) findViewById(R.id.image_btn_9);
		if(reg_seats.contains("9"))
		{
			btn_seat_9.setEnabled(false);
			btn_seat_9.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_10 = (ImageButton) findViewById(R.id.image_btn_10);
		if(reg_seats.contains("10"))
		{
			btn_seat_10.setEnabled(false);
			btn_seat_10.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_11 = (ImageButton) findViewById(R.id.image_btn_11);
		if(reg_seats.contains("11"))
		{
			btn_seat_11.setEnabled(false);
			btn_seat_11.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_12 = (ImageButton) findViewById(R.id.image_btn_12);
		if(reg_seats.contains("12"))
		{
			btn_seat_12.setEnabled(false);
			btn_seat_12.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_13 = (ImageButton) findViewById(R.id.image_btn_13);
		if(reg_seats.contains("13"))
		{
			btn_seat_13.setEnabled(false);
			btn_seat_13.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_14 = (ImageButton) findViewById(R.id.image_btn_14);
		if(reg_seats.contains("14"))
		{
			btn_seat_14.setEnabled(false);
			btn_seat_14.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_15 = (ImageButton) findViewById(R.id.image_btn_15);
		if(reg_seats.contains("15"))
		{
			btn_seat_15.setEnabled(false);
			btn_seat_15.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_16 = (ImageButton) findViewById(R.id.image_btn_16);
		if(reg_seats.contains("16"))
		{
			btn_seat_16.setEnabled(false);
			btn_seat_16.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_17 = (ImageButton) findViewById(R.id.image_btn_17);
		if(reg_seats.contains("17"))
		{
			btn_seat_17.setEnabled(false);
			btn_seat_17.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_18 = (ImageButton) findViewById(R.id.image_btn_18);
		if(reg_seats.contains("18"))
		{
			btn_seat_18.setEnabled(false);
			btn_seat_18.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_19 = (ImageButton) findViewById(R.id.image_btn_19);
		if(reg_seats.contains("19"))
		{
			btn_seat_19.setEnabled(false);
			btn_seat_19.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_20 = (ImageButton) findViewById(R.id.image_btn_20);
		if(reg_seats.contains("20"))
		{
			btn_seat_20.setEnabled(false);
			btn_seat_20.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_21 = (ImageButton) findViewById(R.id.image_btn_21);
		if(reg_seats.contains("21"))
		{
			btn_seat_21.setEnabled(false);
			btn_seat_21.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_22 = (ImageButton) findViewById(R.id.image_btn_22);
		if(reg_seats.contains("22"))
		{
			btn_seat_22.setEnabled(false);
			btn_seat_22.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_23 = (ImageButton) findViewById(R.id.image_btn_23);
		if(reg_seats.contains("23"))
		{
			btn_seat_23.setEnabled(false);
			btn_seat_23.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_24 = (ImageButton) findViewById(R.id.image_btn_24);
		if(reg_seats.contains("24"))
		{
			btn_seat_24.setEnabled(false);
			btn_seat_24.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_25 = (ImageButton) findViewById(R.id.image_btn_25);
		if(reg_seats.contains("25"))
		{
			btn_seat_25.setEnabled(false);
			btn_seat_25.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_26 = (ImageButton) findViewById(R.id.image_btn_26);
		if(reg_seats.contains("26"))
		{
			btn_seat_26.setEnabled(false);
			btn_seat_26.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_27 = (ImageButton) findViewById(R.id.image_btn_27);
		if(reg_seats.contains("27"))
		{
			btn_seat_27.setEnabled(false);
			btn_seat_27.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_28 = (ImageButton) findViewById(R.id.image_btn_28);
		if(reg_seats.contains("28"))
		{
			btn_seat_28.setEnabled(false);
			btn_seat_28.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_29 = (ImageButton) findViewById(R.id.image_btn_29);
		if(reg_seats.contains("29"))
		{
			btn_seat_29.setEnabled(false);
			btn_seat_29.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_30 = (ImageButton) findViewById(R.id.image_btn_30);
		if(reg_seats.contains("30"))
		{
			btn_seat_30.setEnabled(false);
			btn_seat_30.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_31 = (ImageButton) findViewById(R.id.image_btn_31);
		if(reg_seats.contains("31"))
		{
			btn_seat_31.setEnabled(false);
			btn_seat_31.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_32 = (ImageButton) findViewById(R.id.image_btn_32);
		if(reg_seats.contains("32"))
		{
			btn_seat_32.setEnabled(false);
			btn_seat_32.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_33 = (ImageButton) findViewById(R.id.image_btn_33);
		if(reg_seats.contains("33"))
		{
			btn_seat_33.setEnabled(false);
			btn_seat_33.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_34 = (ImageButton) findViewById(R.id.image_btn_34);
		if(reg_seats.contains("34"))
		{
			btn_seat_34.setEnabled(false);
			btn_seat_34.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_35 = (ImageButton) findViewById(R.id.image_btn_35);
		if(reg_seats.contains("35"))
		{
			btn_seat_35.setEnabled(false);
			btn_seat_35.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_36 = (ImageButton) findViewById(R.id.image_btn_36);
		if(reg_seats.contains("36"))
		{
			btn_seat_36.setEnabled(false);
			btn_seat_36.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_37 = (ImageButton) findViewById(R.id.image_btn_37);
		if(reg_seats.contains("37"))
		{
			btn_seat_37.setEnabled(false);
			btn_seat_37.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_38 = (ImageButton) findViewById(R.id.image_btn_38);
		if(reg_seats.contains("38"))
		{
			btn_seat_38.setEnabled(false);
			btn_seat_38.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_39 = (ImageButton) findViewById(R.id.image_btn_39);
		if(reg_seats.contains("39"))
		{
			btn_seat_39.setEnabled(false);
			btn_seat_39.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_40 = (ImageButton) findViewById(R.id.image_btn_40);
		if(reg_seats.contains("40"))
		{
			btn_seat_40.setEnabled(false);
			btn_seat_40.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_41 = (ImageButton) findViewById(R.id.image_btn_41);
		if(reg_seats.contains("41"))
		{
			btn_seat_41.setEnabled(false);
			btn_seat_41.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_42 = (ImageButton) findViewById(R.id.image_btn_42);
		if(reg_seats.contains("42"))
		{
			btn_seat_42.setEnabled(false);
			btn_seat_42.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_43 = (ImageButton) findViewById(R.id.image_btn_43);
		if(reg_seats.contains("43"))
		{
			btn_seat_43.setEnabled(false);
			btn_seat_43.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_44 = (ImageButton) findViewById(R.id.image_btn_44);
		if(reg_seats.contains("44"))
		{
			btn_seat_44.setEnabled(false);
			btn_seat_44.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_45 = (ImageButton) findViewById(R.id.image_btn_45);
		if(reg_seats.contains("45"))
		{
			btn_seat_45.setEnabled(false);
			btn_seat_45.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_46 = (ImageButton) findViewById(R.id.image_btn_46);
		if(reg_seats.contains("46"))
		{
			btn_seat_46.setEnabled(false);
			btn_seat_46.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_47 = (ImageButton) findViewById(R.id.image_btn_47);
		if(reg_seats.contains("47"))
		{
			btn_seat_47.setEnabled(false);
			btn_seat_47.setBackgroundResource(R.drawable.seat_v);
		}
		btn_seat_48 = (ImageButton) findViewById(R.id.image_btn_48);
		if(reg_seats.contains("48"))
		{
			btn_seat_48.setEnabled(false);
			btn_seat_48.setBackgroundResource(R.drawable.seat_v);
		}

		btn_seat_1.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {

				/*
				 * seat_numb=1; String seat_no= "1"; Toast.makeText(FromTo.this,
				 * seat_no, Toast.LENGTH_SHORT).show();
				 */
				// seats[0] = 1;

				toggleSeatsButton(btn_seat_1, 1);

			}
		});

		btn_seat_2.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				toggleSeatsButton(btn_seat_2, 2);
			}
		});

		btn_seat_3.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				toggleSeatsButton(btn_seat_3, 3);

			}
		});

		btn_seat_4.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				toggleSeatsButton(btn_seat_4, 4);

			}
		});

		btn_seat_5.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				toggleSeatsButton(btn_seat_5, 5);
			}
		});

		btn_seat_6.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				toggleSeatsButton(btn_seat_6, 6);
			}
		});

		btn_seat_7.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_7, 7);
			}
		});

		btn_seat_8.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_8, 8);
			}
		});

		btn_seat_9.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_9, 9);
			}
		});

		btn_seat_10.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_10, 10);
			}
		});

		btn_seat_11.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_11, 11);
			}
		});

		btn_seat_12.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				toggleSeatsButton(btn_seat_12, 12);
			}
		});

		btn_seat_13.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				toggleSeatsButton(btn_seat_13, 13);
			}
		});

		btn_seat_14.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				toggleSeatsButton(btn_seat_14, 14);
			}
		});

		btn_seat_15.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				toggleSeatsButton(btn_seat_15, 15);
			}
		});

		btn_seat_16.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				toggleSeatsButton(btn_seat_16, 16);
			}
		});

		btn_seat_17.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_17, 17);
			}
		});

		btn_seat_18.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_18, 18);
			}
		});

		btn_seat_19.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_19, 19);
			}
		});

		btn_seat_20.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_20, 20);
			}
		});

		btn_seat_21.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_21, 21);
			}
		});

		btn_seat_22.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_22, 22);
			}
		});

		btn_seat_23.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_23, 23);
			}
		});

		btn_seat_24.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_24, 24);
			}
		});

		btn_seat_25.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_25, 25);
			}
		});

		btn_seat_26.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_26, 26);
			}
		});

		btn_seat_27.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_27, 27);
			}
		});

		btn_seat_28.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_28, 28);
			}
		});

		btn_seat_29.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_29, 29);
			}
		});

		btn_seat_30.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_30, 30);
			}
		});

		btn_seat_31.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_31, 31);
			}
		});

		btn_seat_32.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_32, 32);
			}
		});
		btn_seat_33.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_33, 33);
			}
		});
		btn_seat_34.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_34, 34);
			}
		});
		btn_seat_35.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_35, 35);
			}
		});
		btn_seat_36.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_36, 36);
			}
		});
		btn_seat_37.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_37, 37);
			}
		});
		btn_seat_38.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_38, 38);
			}
		});
		btn_seat_39.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_39, 39);
			}
		});
		btn_seat_40.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_40, 40);
			}
		});
		btn_seat_41.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_41, 41);
			}
		});
		btn_seat_42.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_42, 42);
			}
		});

		btn_seat_43.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_43, 43);
			}
		});
		btn_seat_44.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_44, 44);
			}
		});
		btn_seat_45.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_45, 45);
			}
		});
		btn_seat_46.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_46, 46);
			}
		});
		btn_seat_47.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_47, 47);
			}
		});
		btn_seat_48.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				toggleSeatsButton(btn_seat_48, 48);
			}
		});

		btn_proceed = (Button) findViewById(R.id.btn_proceed_xml);

		btn_proceed.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

				try {
					if (setcustMsisdnFB()) {
						startActivity(new Intent(FromTo.this, PyOnCash.class));

					}

					else {

						Toast.makeText(FromTo.this, "Try Again",
								Toast.LENGTH_LONG).show();
					}
				} catch (Exception e) {

				}

			}
		});

	}

	public void toggleSeatsButton(ImageButton button, int index) {

		if (isChecked[index - 1]) {
			isChecked[index - 1] = false;
			button.setBackgroundResource(R.drawable.unselected_seat_v);
			for (int i = 0; i < seats.size(); i++) {
				if (seats.get(i) == index) {
					seats.remove(i);
					break;
				}
			}
		} else {
			if (seats.size() == 4) {
				Toast.makeText(FromTo.this, "sorry no more seats",
						Toast.LENGTH_SHORT).show();
			} else {
				seats.add(index);
				button.setBackgroundResource(R.drawable.seat_v);
				isChecked[index - 1] = true;
			}

		}
		String seatsRegistered = "Seat(s): ";
		for (int i = 0; i < seats.size(); i++) {
			if (i != 0)
				seatsRegistered = seatsRegistered + ",";
			seatsRegistered = seatsRegistered + seats.get(i).toString();
		}
		txt_numb_seats.setText(seatsRegistered);

	}

	public boolean setcustMsisdnFB() throws IOException, XmlPullParserException {

		val = prefs.getString(AppConstants.USER_ID, null);
		if (!val.equals(null)) {
			id_user = Integer.parseInt(val);
			
		}
		
		val2 = prefs.getString(AppConstants.TRAVEL_ID, null);
		if (!val2.equals(null)) {
			travle_id = Integer.parseInt(val2);
			
		}
		
		
		
		String str_seasts_number = "";
		for (int i = 0; i < seats.size(); i++) {
			if(i != 0)
				str_seasts_number += ",";
			str_seasts_number = str_seasts_number + seats.get(i);
		}

		SoapObject request = new SoapObject(NAMESPACE, METHODNAME);

		
		request.addProperty("id", id_user);
		request.addProperty("travel_id", travle_id);
		request.addProperty("number_of_seat", seats.size());
		request.addProperty("seat_number", str_seasts_number);

		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		envelope.dotNet = true;
		MarshalBase64 m = new MarshalBase64();
		m.register(envelope);
		envelope.encodingStyle = SoapEnvelope.ENC;
		// send request
		envelope.setOutputSoapObject(request);
		HttpTransportSE androidHttpTransport = new HttpTransportSE(url);
		androidHttpTransport.call(SopaAction, envelope);
		// get response
		KvmSerializable ks = (KvmSerializable) envelope.bodyIn;
		String result = ks.getProperty(0).toString();

		if (result.equals("Successs")) {
			Toast.makeText(FromTo.this, "Feedback Success", Toast.LENGTH_LONG)
					.show();
			return true;
		} else {
			Toast.makeText(FromTo.this, "FeedBack Failed", Toast.LENGTH_LONG)
					.show();
			return false;
		}

	}

}
